import request from '@/utils/request'

// 查询容器列表
export function listContainer(query) {
  return request({
    url: '/docker/container/list',
    method: 'get',
    params: query
  })
}

// 启动容器
export function startContainer(data) {
  return request({
    url: '/docker/container/start',
    method: 'put',
    data: data
  })
}

// 停止容器
export function stopContainer(data) {
  return request({
    url: '/docker/container/stop',
    method: 'put',
    data: data
  })
}

// 查询容器详细
export function getContainer(query) {
  return request({
    url: '/docker/container/inspect',
    method: 'get',
    params: query
  })
}

// 新增容器
export function addContainer(data) {
  return request({
    url: '/docker/container',
    method: 'post',
    data: data
  })
}

// 修改容器
export function updateContainer(data) {
  return request({
    url: '/docker/container',
    method: 'put',
    data: data
  })
}

// 删除容器
export function delContainer(name) {
  return request({
    url: '/docker/container/' + name,
    method: 'delete'
  })
}
